#include <iostream>

using namespace std;

const int N = 100010;
int n;
int m;
int x;
int arr[N];

int main()
{
	cin >> n;
	for(int i = 0; i< n ; i ++)
	{
		int k;
		cin >> k;
		if(k==1) cin >> x;
		else
		{
			while(k--)
			{
				cin >> x;
				arr[x] = 1;
			}
		}
	}
	cin >> m;
	int flag = 0;
	for(int i = 0 ; i < m; i ++ )
	{
		cin >> x;
		if(arr[x]==0 && flag == 0)
		{
			printf("%05d",x);
			flag = 1;
		}
		else if(arr[x]==0) printf(" %05d",x);
		arr[x] = 1;
	}
	if(!flag) printf("No one is handsome");
	return 0;
}
